using System.ComponentModel.DataAnnotations;
using SqlSugar;

namespace TradeFlow.Server.Models;

/// <summary>
/// 业务单表头信息
/// </summary>
[SugarTable(nameof(JxBillHead), "业务单表头信息")]
public class JxBillHead : EntityBase
{
    /// <summary>
    /// 单据类型（进货、进退货、销货、销退货）
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "单据类型")]
    public string Type { get; set; }

    /// <summary>
    /// 业务单号
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "业务单号")]
    public string BillNo { get; set; }

    /// <summary>
    /// 单证状态
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "单证状态")]
    public string Status { get; set; }

    /// <summary>
    /// 单证日期
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "单证日期")]
    public DateTime? BillDate { get; set; }

    /// <summary>
    /// 商业伙伴
    /// </summary>
    [Required, MaxLength(100)]
    [SugarColumn(ColumnDescription = "商业伙伴")]
    public string Partner { get; set; }

    /// <summary>
    /// 合同号
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "合同号", IsNullable = true)]
    public string ContractNo { get; set; }

    /// <summary>
    /// 发票号
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "发票号", IsNullable = true)]
    public string InvoiceNo { get; set; }

    /// <summary>
    /// 结算方式
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "结算方式")]
    public string SettleMode { get; set; }

    /// <summary>
    /// 总金额
    /// </summary>
    [SugarColumn(ColumnDescription = "总金额", IsNullable = true, ColumnDataType = "decimal(18,2)")]
    public decimal? TotalAmount { get; set; }

    /// <summary>
    /// 物流公司
    /// </summary>
    [MaxLength(100)]
    [SugarColumn(ColumnDescription = "物流公司", IsNullable = true)]
    public string Logistics { get; set; }

    /// <summary>
    /// 物流单号
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "物流单号", IsNullable = true)]
    public string LogisticsNo { get; set; }

    /// <summary>
    /// 物流费用
    /// </summary>
    [SugarColumn(ColumnDescription = "物流费用", IsNullable = true, ColumnDataType = "decimal(18,2)")]
    public decimal? LogisticsFee { get; set; }

    /// <summary>
    /// 退货单号
    /// </summary>
    [MaxLength(50)]
    [SugarColumn(ColumnDescription = "退货单号", IsNullable = true)]
    public string ReturnNo { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string Note { get; set; }

    /// <summary>
    /// 附件
    /// </summary>
    [MaxLength(500)]
    [SugarColumn(ColumnDescription = "附件", IsNullable = true)]
    public string Files { get; set; }
}